cmake_minimum_required(VERSION 3.10)
project(smartFarmServer LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 输出目录
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

# 工程自己的头文件目录
include_directories(${CMAKE_SOURCE_DIR}/inc)

# 源文件
file(GLOB SRC_FILES ${CMAKE_SOURCE_DIR}/src/*.cpp)

# 可执行文件
add_executable(${PROJECT_NAME} ${SRC_FILES})

# 链接 mysql 客户端库
target_link_libraries(${PROJECT_NAME} )

# # 禁用警告
# add_compile_options(-Wno-deprecated-declarations)


# 链接 mosquitto (C) 和 mosquittopp (C++) 库
target_link_libraries(${PROJECT_NAME}
    mosquitto
    mosquittopp
    mysqlclient
    pthread
)